/*
 * qiangungun.com Inc.
 * Copyright (c) 2014 All Rights Reserved.
 */package com.qiangungun.report.dal.ibatis;import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;import com.qiangungun.report.dal.daointerface.RptcfgPrtTplDAO;// auto generated importsimport java.util.List;import org.springframework.dao.DataAccessException;import com.qiangungun.report.dal.dataobject.RptcfgPrtTplDO;/** * An ibatis based implementation of dao interface <tt>com.qiangungun.report.dal.daointerface.RptcfgPrtTplDAO</tt>. * * This file is generated by <tt>financenet-dalgen</tt>, a DAL (Data Access Layer)
 * code generation utility specially developed for <tt>iwallet</tt> project.
 * 
 * PLEASE DO NOT MODIFY THIS FILE MANUALLY, or else your modification may
 * be OVERWRITTEN by someone else. To modify the file, you should go to 
 * directory <tt>(project-home)/biz/dal/src/conf/dalgen</tt>, and 
 * find the corresponding configuration file (<tt>tables/rptcfg_prt_tpl.xml</tt>). 
 * Modify the configuration file according to your needs, then run <tt>financenet-dalgen</tt> 
 * to generate this file.
 *
 */@SuppressWarnings({"unchecked","deprecation"})public class IbatisRptcfgPrtTplDAO extends SqlMapClientDaoSupport implements RptcfgPrtTplDAO {	/**
	 *  Query DB table <tt>rptcfg_prt_tpl</tt> for records.
	 *
	 *  <p>
	 *  The sql statement for this operation is <br>
	 *  <tt>select ID, TPL_CODE, TPL_NAME, PATH, CATEGORY, STATUS from rptcfg_prt_tpl</tt>
	 *
	 *	@return List<RptcfgPrtTplDO>
	 *	@throws DataAccessException
	 */	 
    public List<RptcfgPrtTplDO> loadAll() throws DataAccessException {

        return getSqlMapClientTemplate().queryForList("MS-RPTCFG-PRT-TPL-LOAD-ALL", null);

    }		/**
	 *  Query DB table <tt>rptcfg_prt_tpl</tt> for records.
	 *
	 *  <p>
	 *  The sql statement for this operation is <br>
	 *  <tt>select ID, TPL_CODE, TPL_NAME, PATH, CATEGORY, STATUS from rptcfg_prt_tpl where (TPL_CODE = ?)</tt>
	 *
	 *	@param tplCode
	 *	@return RptcfgPrtTplDO
	 *	@throws DataAccessException
	 */	 
    public RptcfgPrtTplDO queryByTplCode(String tplCode) throws DataAccessException {

        return (RptcfgPrtTplDO) getSqlMapClientTemplate().queryForObject("MS-RPTCFG-PRT-TPL-QUERY-BY-TPL-CODE", tplCode);

    }		/**
	 *  Insert one <tt>RptcfgPrtTplDO</tt> object to DB table <tt>rptcfg_prt_tpl</tt>, return primary key
	 *
	 *  <p>
	 *  The sql statement for this operation is <br>
	 *  <tt>insert into rptcfg_prt_tpl(ID,TPL_CODE,TPL_NAME,PATH,CATEGORY,STATUS) values (?, ?, ?, ?, ?, ?)</tt>
	 *
	 *	@param rptcfgPrtTpl
	 *	@return Long
	 *	@throws DataAccessException
	 */	 
    public Long insert(RptcfgPrtTplDO rptcfgPrtTpl) throws DataAccessException {
    	if (rptcfgPrtTpl == null) {
    		throw new IllegalArgumentException("Can't insert a null data object into db.");
    	}
    	
        getSqlMapClientTemplate().insert("MS-RPTCFG-PRT-TPL-INSERT", rptcfgPrtTpl);

        return rptcfgPrtTpl.getId();
    }		/**
	 *  Delete records from DB table <tt>rptcfg_prt_tpl</tt>.
	 *
	 *  <p>
	 *  The sql statement for this operation is <br>
	 *  <tt>delete from rptcfg_prt_tpl where (ID = ?)</tt>
	 *
	 *	@param rptcfgPrtTpl
	 *	@return int
	 *	@throws DataAccessException
	 */	 
    public int delete(RptcfgPrtTplDO rptcfgPrtTpl) throws DataAccessException {
    	if (rptcfgPrtTpl == null) {
    		throw new IllegalArgumentException("Can't delete by a null data object.");
    	}


        return getSqlMapClientTemplate().delete("MS-RPTCFG-PRT-TPL-DELETE", rptcfgPrtTpl);
    }	/**
	 *  Update DB table <tt>rptcfg_prt_tpl</tt>.
	 *
	 *  <p>
	 *  The sql statement for this operation is <br>
	 *  <tt>update rptcfg_prt_tpl set TPL_CODE=?, TPL_NAME=?, PATH=?, CATEGORY=?, STATUS=? where (ID = ?)</tt>
	 *
	 *	@param rptcfgPrtTpl
	 *	@return int
	 *	@throws DataAccessException
	 */	 
    public int update(RptcfgPrtTplDO rptcfgPrtTpl) throws DataAccessException {
    	if (rptcfgPrtTpl == null) {
    		throw new IllegalArgumentException("Can't update by a null data object.");
    	}


        return getSqlMapClientTemplate().update("MS-RPTCFG-PRT-TPL-UPDATE", rptcfgPrtTpl);
    }	}	